import Cookies from "js-cookie";
import locale from "element-ui/lib/locale/lang/en";
import zhLocale from "element-ui/lib/locale/lang/zh-CN";
const TokenKey = "Admin-Token";

export function getToken() {
  // let token = Cookies.get(TokenKey)||sessionStorage.getItem('TokenKey')
  let token = sessionStorage.getItem("TokenKey");
  return token;
}

export function setToken(token) {
  return Cookies.set(TokenKey, token);
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}

export function i18nsTime() {
  let i18n = localStorage.getItem("setLanguage");
  if (i18n == "zh_CN") {
    return { zhLocale };
  } else {
    return { locale };
  }
}
